});
// Potentially upgrade suffix vfs to windows vfs
- ENFORCE(_vfs);
+ Q_ASSERT(_vfs);
if (_definition.virtualFilesMode == Vfs::WithSuffix
&& _definition.upgradeVfsMode) {
if (isVfsPluginAvailable(Vfs::WindowsCfApi)) {
void Folder::startVfs()
{
- ENFORCE(_vfs);
- ENFORCE(_vfs->mode() == _definition.virtualFilesMode);
+ Q_ASSERT(_vfs);
+ Q_ASSERT(_vfs->mode() == _definition.virtualFilesMode);
const auto result = Vfs::checkAvailability(path(), _vfs->mode());
if (!result) {
void AbstractNetworkJob::retry()
{
- ENFORCE(_reply);
+ Q_ASSERT(_reply);
auto req = _reply->request();
QUrl requestedUrl = req.url();
QByteArray verb = HttpLogger::requestVerb(*_reply);
item->_size = sizeOnServer;
if (serverEntry.isDirectory) {
- ENFORCE(dbEntry.isDirectory());
+ Q_ASSERT(dbEntry.isDirectory());
item->_instruction = CSYNC_INSTRUCTION_UPDATE_METADATA;
} else if (!localEntry.isValid() && _queryLocal != ParentNotChanged) {
// Deleted locally, changed on server
void DiscoveryPhase::startJob(ProcessDirectoryJob *job)
{
- ENFORCE(!_currentRootJob);
+ Q_ASSERT(!_currentRootJob);
connect(this, &DiscoveryPhase::itemDiscovered, this, &DiscoveryPhase::slotItemDiscovered, Qt::UniqueConnection);
connect(job, &ProcessDirectoryJob::finished, this, [this, job] {
- ENFORCE(_currentRootJob == sender());
+ Q_ASSERT(_currentRootJob == sender());
_currentRootJob = nullptr;
if (job->_dirItem)
emit itemDiscovered(job->_dirItem);
void PropagateItemJob::done(const SyncFileItem::Status statusArg, const QString &errorString, const ErrorCategory category)
{
// Duplicate calls to done() are a logic error
- ENFORCE(_state != Finished);
+ Q_ASSERT(_state != Finished);
_state = Finished;
_item->_status = statusArg;
// Delete the job and remove it from our list of jobs.
subJob->deleteLater();
int i = _runningJobs.indexOf(subJob);
- ENFORCE(i >= 0); // should only happen if this function is called more than once
+ Q_ASSERT(i >= 0); // should only happen if this function is called more than once
_runningJobs.remove(i);
// Any sub job error will cause the whole composite to fail. This is important